import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-ng-style',
  templateUrl: './ng-style.component.html',
  styleUrls: ['./ng-style.component.scss']
})
export class NgStyleComponent implements OnInit {

  dataOptions: any = {
    width: "300px",
    height: "150px",
    background: "#FFFFFF",
    margin: "60px 30px 0px 60px"
  }

  options:any = {
    width:"140px",
    text:"更改style高度属性"
  };
  constructor() { }

  ngOnInit() {
  }

  btnClick() {
    if (this.dataOptions.height === "150px") {
      this.dataOptions.height = "300px"
    }
    else {
      this.dataOptions.height = "150px"
    }
  }
}
